<template>
	<view>
		<!-- <web-view src="" @message="handleMessage"></web-view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				site: {},
				curUrl: '',
				currentWebview: null
			};
		},
		onLoad(e) {
			this.site = JSON.parse(e.site);

			let pages = getCurrentPages(),
				page = pages[pages.length - 1],
				_self = this;
			let currentWebview = page.$getAppWebview(),
				newWebview = plus.webview.create(this.site.url, 'py', {top:'70px'});


			newWebview.onloaded = function(e) {
				_self.curUrl = newWebview.getURL();
			}
			currentWebview.append(newWebview);
		},

		onNavigationBarButtonTap(e) {
			console.log('detail:' + this.curUrl);
			uni.navigateTo({
				url: "../index/play?url=" + this.curUrl
			});
		}
	}
</script>

<style>
	.hide {
		display: none;
	}

	.show {
		display: block;
		margin-top: 1rem;
	}
</style>
